摄影师端app的工作目录不被扫码

chengzhenyu 8 jaren geleden
bovenliggende
commit
fa8c649fd8
2 gewijzigde bestanden met toevoegingen van 17 en 3 verwijderingen
  1. 2 2
      app/build.gradle
  2. 15 1
      app/src/main/java/ai/pai/lensman/App.java

+ 2 - 2
app/build.gradle

@@ -20,8 +20,8 @@ android {
20 20
         applicationId "ai.pai.lensman"
21 21
         minSdkVersion MIN_SDK_VERSION as int
22 22
         targetSdkVersion TARGET_SDK_VERSION as int
23
-        versionCode 1012
24
-        versionName "1.0.12"
23
+        versionCode 1013
24
+        versionName "1.0.13"
25 25
         buildConfigField "boolean", "isTestMode", "true"
26 26
         manifestPlaceholders = [CHANNEL_NAME: "guanwang"]
27 27
     }

+ 15 - 1
app/src/main/java/ai/pai/lensman/App.java

@@ -12,6 +12,7 @@ import com.nostra13.universalimageloader.core.assist.QueueProcessingType;
12 12
 import com.nostra13.universalimageloader.utils.StorageUtils;
13 13
 
14 14
 import java.io.File;
15
+import java.io.IOException;
15 16
 
16 17
 import ai.pai.lensman.utils.Constants;
17 18
 import ai.pai.lensman.utils.PatchManager;
@@ -31,9 +32,22 @@ public class App extends Application {
31 32
         initImageLoader();
32 33
         mInstance = this.getApplicationContext();
33 34
         new PatchManager().patch(this, UrlContainer.PATCH_CONFIG_URL,Constants.APP_PATCH_DIR+ File.separator+"patch-"+BuildConfig.VERSION_NAME+".dex","ai.pai.lensman.patch.PatchesInfoImpl");
34
-
35
+        noMedia();
35 36
     }
36 37
 
38
+    private void noMedia(){
39
+        File noMedia = new File(Constants.APP_ROOT_DIR,".nomedia");
40
+        if(noMedia.exists()){
41
+            return;
42
+        }
43
+        try {
44
+            File rootDir = new File(Constants.APP_ROOT_DIR);
45
+            rootDir.mkdirs();
46
+            noMedia.createNewFile();
47
+        }catch (IOException e){
48
+            e.printStackTrace();
49
+        }
50
+    }
37 51
 
38 52
     private void initImageLoader() {
39 53